﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Data;
using System.Web;
using System.Collections.Specialized;
using System.Collections;

namespace CodeArt.SharePoint.MultiLanSupport
{    
    /// <summary>
    /// 当客户端语言跟站点语言相同时的转换器
    /// </summary>
    class SameLanTranslator : ITranslator
    {

        LanMapper _mapper = new LanMapper() ;

        Hashtable _keys;

        #region ITranslator Members

        /// <summary>
        /// 
        /// </summary>
        /// <param name="from"></param>
        /// <param name="toLan"></param>
        /// <param name="transSueecss"></param>
        /// <returns></returns>
        public string Translate(string from, string toLan , out bool transSueecss)
        {
            if (_keys == null)
                _keys = _mapper.GetLanKeys();

            //确保只有配置了的key才进行转换
            transSueecss = _keys.ContainsKey(from);

            return from;           
        }

        #endregion
    }
}
